﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using System.Configuration;

namespace DosyaUpload
{
    /// <summary>
    /// Interaction logic for frmMessageBox.xaml
    /// </summary>
    public partial class frmMessageBox : Window
    {
        public frmMessageBox(string mesaj)
        {
            InitializeComponent();
            lblMesaj.Content = mesaj;
        }

        private void btnYes_Click(object sender, RoutedEventArgs e)
        {
            DialogResult = true;
            Close();
        }

        private void btnNo_Click(object sender, RoutedEventArgs e)
        {
            DialogResult = false;
            Close();
        }

        Configuration config = null;
        private void checkBox1_Checked(object sender, RoutedEventArgs e)
        {
            config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
            config.AppSettings.Settings["UpdateFlag"].Value = "0";   //         
            config.Save();
        }

        private void checkBox1_Unchecked(object sender, RoutedEventArgs e)
        {
            config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
            config.AppSettings.Settings["UpdateFlag"].Value = "1";
            config.Save();
        }

        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            if (ConfigurationManager.AppSettings["UpdateFlag"] == "0")
                checkBox1.IsChecked = true;
            else
                checkBox1.IsChecked = false;
        }
    }
}
